/*
 * // Bristleback plugin - Copyright (c) 2010 bristleback.googlecode.com
 * // ---------------------------------------------------------------------------
 * // This program is free software; you can redistribute it and/or modify it
 * // under the terms of the GNU Lesser General Public License as published by the
 * // Free Software Foundation; either version 3 of the License, or (at your
 * // option) any later version.
 * // This library is distributed in the hope that it will be useful,
 * // but without any warranty; without even the implied warranty of merchantability
 * // or fitness for a particular purpose.
 * // You should have received a copy of the GNU Lesser General Public License along
 * // with this program; if not, see <http://www.gnu.org/licenses/lgpl.html>.
 * // ---------------------------------------------------------------------------
 */

package pl.bristleback.server.bristle.token;

import org.apache.log4j.Logger;
import org.jwebsocket.token.Token;

/**
 * Wrapper class containing information taken from {@link Tokenize} annotation.
 * <p/>
 * Created on: 2010-12-16 18:24:15 <br/>
 *
 * @author Wojciech Niemiec
 */
public class TokenizerWrapper {
  private static Logger log = Logger.getLogger(TokenizerWrapper.class.getName());

  private boolean deepSearch;
  private String name;
  private TokenizerEngine tokenizerEngine;
  private String[] parameterNames;

  /**
   * Adds values to token using {@link TokenizerEngine} implementation.
   *
   * @param token  a token to fill.
   * @param values values to add.
   */
  public void tokenize(Token token, Object... values) {
    tokenizerEngine.tokenize(token, deepSearch, parameterNames, values);
  }

  public void setDeepSearch(boolean deepSearch) {
    this.deepSearch = deepSearch;
  }

  public void setTokenizerEngine(TokenizerEngine tokenizerEngine) {
    this.tokenizerEngine = tokenizerEngine;
  }

  public String[] getParameterNames() {
    return parameterNames;
  }

  public void setParameterNames(String[] parameterNames) {
    this.parameterNames = parameterNames;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }
}
